package com.ruoyi.mall.product.domain.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.mall.product.domain.service.IPmsCommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.mall.product.domain.repository.PmsCommentMapper;
import com.ruoyi.mall.product.domain.entity.PmsComment;

/**
 * 商品评价Service业务层处理
 *
 * @author zhangqishu
 * @date 2022-05-25
 */
@Service
public class PmsCommentServiceImpl implements IPmsCommentService
{
    @Autowired
    private PmsCommentMapper pmsCommentMapper;

    /**
     * 查询商品评价
     *
     * @param id 商品评价主键
     * @return 商品评价
     */
    @Override
    public PmsComment selectPmsCommentById(Long id)
    {
        return pmsCommentMapper.selectPmsCommentById(id);
    }

    /**
     * 查询商品评价列表
     *
     * @param pmsComment 商品评价
     * @return 商品评价
     */
    @Override
    public List<PmsComment> selectPmsCommentList(PmsComment pmsComment)
    {
        return pmsCommentMapper.selectPmsCommentList(pmsComment);
    }

    /**
     * 新增商品评价
     *
     * @param pmsComment 商品评价
     * @return 结果
     */
    @Override
    public int insertPmsComment(PmsComment pmsComment)
    {
        pmsComment.setCreateTime(DateUtils.getNowDate());
        return pmsCommentMapper.insertPmsComment(pmsComment);
    }

    /**
     * 修改商品评价
     *
     * @param pmsComment 商品评价
     * @return 结果
     */
    @Override
    public int updatePmsComment(PmsComment pmsComment)
    {
        return pmsCommentMapper.updatePmsComment(pmsComment);
    }

    /**
     * 批量删除商品评价
     *
     * @param ids 需要删除的商品评价主键
     * @return 结果
     */
    @Override
    public int deletePmsCommentByIds(Long[] ids)
    {
        return pmsCommentMapper.deletePmsCommentByIds(ids);
    }

    /**
     * 删除商品评价信息
     *
     * @param id 商品评价主键
     * @return 结果
     */
    @Override
    public int deletePmsCommentById(Long id)
    {
        return pmsCommentMapper.deletePmsCommentById(id);
    }
}
